package com.vercon.commonmirror.utils

import android.graphics.Rect
import android.view.View
import android.view.animation.Animation
import android.view.animation.ScaleAnimation
import androidx.recyclerview.widget.RecyclerView

/**
 * Created by YZC on 2019/8/1
 */
class utils

fun smartHomeIn() = ScaleAnimation(
        0.7f,
        1f,
        0.7f,
        1f,
        Animation.RELATIVE_TO_SELF,
        0.5f,
        Animation.RELATIVE_TO_SELF,
        0.5f
).also {
    it.duration = 300
}

fun noAnimation() = ScaleAnimation(0.5f, 1f, 0.5f, 1f).also { it.duration = 0 }

class RVDecoration(val space: Int = 50) : RecyclerView.ItemDecoration() {
    override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
        outRect.right = space
        outRect.bottom = space
    }
}
